package com.example.ydkf1;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity{
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        DeveloperObserver A = new DeveloperObserver("A");
        DeveloperObserver B = new DeveloperObserver("B");
        DeveloperObserver C = new DeveloperObserver("C");

        AndroidVersionSubject av = new AndroidVersionSubject();
        av.addObserver(A);
        av.addObserver(B);
        av.addObserver(C);
        av.postNewVersion("Android 18 updated!");
        av.deleteObserver(A);
        av.postNewVersion("Android 19 updated!");
    }
}